// 用户相关的api 接口
import request from '@/utils/requiest'


// 1. 验证手机号是否被注册
export const checkPhoneApi = (tel: string) => request.post('/user/docheckphone', { tel })

// 2. 发送短信验证码
export const sendCodeApi = (tel: string) => request.post('/user/dosendmsgcode', { tel })

// 3. 验证手机验证码
export const checkCodeApi = (tel: string, telcode: string) => request.post('/user/docheckcode', { tel, telcode })

// 4. 确认注册
export const registerApi = (tel: string, password: string) => request.post('/user/dofinishregister', { tel, password })

// 5. 确认登录
export const loginApi = (loginname: string, password: string) => request.post('/user/login', { loginname, password })

// 6. 获取用户详细信息
export const getUserInfoApi = (userid: string) => request.get('/user/info', { params: { userid } })
